Skip to content

Conversation

devjiwonchoi
Copy link

@devjiwonchoi devjiwonchoi commented Aug 27, 2025

Backports #56299 to v20.x.

When bumping v18 to v20, I received the following error from a test fixture with an invalid source-map.

TypeError [ERR_INVALID_ARG_TYPE]: The \"payload\" argument must be of type object. Received null
  at cloneSourceMapV3 (node:internal/source_map/source_map:365:3)
  at new SourceMap (node:internal/source_map/source_map:145:21)
  at findSourceMap (node:internal/source_map/source_map_cache:352:17)
  at filterStackFrameDEV (file:///Users/devjiwonchoi/code/work/next.js/packages/
  next/dist/compiled/next-server/app-page.runtime.dev.js:23:10359)

Found PR #56299 skips parsing invalid sourcemap, which will suppress this error, was backported to v22.14.0 and v23.6.0, but was never landed on v20.x.

It received the label backport-requested-v20.x on June 5th, but has not been backported yet. Therefore, opened this backporting PR, hopefully proposing to 20.19.5 'Iron'.

cc @marco-ippolito as whom added the label 🙏

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. labels Aug 27, 2025
@devjiwonchoi devjiwonchoi marked this pull request as ready for review August 27, 2025 20:09
@marco-ippolito
Copy link
Member

the [v20.x backport] should not be added in the commit message, we already include some metadata when landing

@devjiwonchoi
Copy link
Author

the [v20.x backport] should not be added in the commit message, we already include some metadata when landing

Got it, removed.

@aduh95
Copy link
Contributor

aduh95 commented Aug 29, 2025

The commit message is different from the one for 28557ef, e.g. the PR-URL is not a URL. Also a33ec12 backport is missing. Let me push a fix for you

@aduh95 aduh95 force-pushed the backport-56299-to-20 branch from 12bcd81 to fb18c72 Compare August 29, 2025 11:08
When the source map data are invalid json strings, skip construct
`SourceMap` on it. Additionally, suppress exceptions on source map
lookups and fix test runners crash on invalid source maps.

PR-URL: nodejs#56299
Refs: nodejs#56296
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
`array.map`.

PR-URL: nodejs#56299
Refs: nodejs#56296
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
@aduh95 aduh95 force-pushed the backport-56299-to-20 branch from fb18c72 to 4c0ad1e Compare August 29, 2025 11:13
@devjiwonchoi
Copy link
Author

The commit message is different from the one for 28557ef, e.g. the PR-URL is not a URL. Also a33ec12 backport is missing. Let me push a fix for you

I see, thanks 🙏

@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@marco-ippolito
Copy link
Member

osx is failing for unrelated reason, I'm backporting

marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
When the source map data are invalid json strings, skip construct
`SourceMap` on it. Additionally, suppress exceptions on source map
lookups and fix test runners crash on invalid source maps.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
`array.map`.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
@marco-ippolito
Copy link
Member

Landed in 42224ac...78f1233

marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
When the source map data are invalid json strings, skip construct
`SourceMap` on it. Additionally, suppress exceptions on source map
lookups and fix test runners crash on invalid source maps.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
`array.map`.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants